package com.rshare.cloud.rspub.trialRegister.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.type.JdbcType;

import com.rshare.cloud.rspub.trialRegister.domain.TrialRegister;

/**
 * 试用注册DAO. <br>
 * <p>
 * Copyright: Copyright (c) 2017年4月24日 上午10:09:19
 * <p>
 * Company: 苏州罗想软件有限公司
 * <p>
 * 
 * @author yi.zhang@roadshare.com
 * @version 1.0.0
 */
@Mapper
public interface TrialRegisterMapper {

	@Insert("insert into PROBREG(REGID,NAME,PHONE,EMAIL,CORPNAME,REGTIME,STATE,ALLOWTIME,STOPTIME,PROBUSER,PROBCROPID) "
			+ "values(#{regId},#{name},#{phone},#{email},#{corpName},#{regTime},#{state},#{allowTime},#{stopTime},#{probUser},#{probCropId})")
    @Results(
     	    {
 @Result(id = true, column = "REGID", property = "regId", jdbcType = JdbcType.VARCHAR),
	        @Result(column = "NAME", property = "name", jdbcType = JdbcType.VARCHAR), 
	        @Result(column = "PHONE", property = "phone",jdbcType = JdbcType.VARCHAR),
	        @Result(column = "EMAIL", property = "email",jdbcType = JdbcType.VARCHAR),
	        @Result(column = "CORPNAME", property = "corpName", jdbcType = JdbcType.VARCHAR), 
	        @Result(column = "STATE", property = "state", jdbcType = JdbcType.VARCHAR),
	        @Result(column = "REGTIME", property = "regTime", jdbcType = JdbcType.DATE),
	        @Result(column = "ALLOWTIME", property = "allowTime", jdbcType = JdbcType.DATE),
	        @Result(column = "STOPTIME", property = "stopTime", jdbcType = JdbcType.DATE),
	        @Result(column = "PROBUSER", property = "probUser", jdbcType = JdbcType.VARCHAR),
	        @Result(column = "PROBCROPID", property = "probCropId", jdbcType = JdbcType.VARCHAR)
     	    })
	public int AddTrialUser(TrialRegister trialUser); // 新增用户

}
